﻿using System;
using System.IO;

namespace 栅格数据结构与算法
{
    class Program
    {
        static void Main(string[] args)
        {

            #region 完全栅格编码
            //Raster raster = new Raster();
            string relatePath = @"..\..\..\RasterData\Raster.txt";
            string absolutePath = Path.GetFullPath(relatePath);
            //raster.ReadDataFromFile(absolutePath);
            //raster.WriteRasterMatrix();
            //double pixelValue = raster.GetPixelValue(3, 4);
            //Console.WriteLine($"(3,4)位置的像元值为:{pixelValue}");
            //double area = raster.GetArea();
            //Console.WriteLine($"面积为：{area}");
            //Console.WriteLine("-----------------------");
            //Console.WriteLine("游程编码为：");
            //raster.ToRunLengthEncoding(); 
            #endregion

            #region 游程编码
            RunLengthEncoding runLengthEncoding = new RunLengthEncoding();
            relatePath = @"..\..\..\RasterData\RunLengthEncoding.txt";
            absolutePath = Path.GetFullPath(relatePath);
            runLengthEncoding.ReadDataFromFile(absolutePath);
            Console.WriteLine("游程栅格编码为：");
            runLengthEncoding.WriteRunLengthEncoding();
            Console.WriteLine("转成完全栅格编码为：");
            runLengthEncoding.ToRaster();
            runLengthEncoding.WriteRasterMatrix(); 
            #endregion
        }
    }
}
